package ink.fujisann.learning.stock.pojo;

import ink.fujisann.learning.code.pojo.BaseInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "stock_debt")
@org.hibernate.annotations.Table(appliesTo = "stock_debt", comment = "赌约")
@DynamicInsert
@DynamicUpdate
@Data
@EqualsAndHashCode(callSuper = true)
public class StockDebt extends BaseInfo {
    @Id
    @GenericGenerator(name = "stock_debt_id", strategy = "org.hibernate.id.UUIDGenerator")
    @GeneratedValue(generator = "stock_debt_id")
    @ApiModelProperty("主键")
    private String id;

    @Column(columnDefinition = "varchar(127) default null comment '标题'")
    @ApiModelProperty("标题")
    private String title;

    @Column(columnDefinition = "varchar(255) default null comment '封面图'")
    @ApiModelProperty("封面图")
    private String coverUri;

    @Column(columnDefinition = "text default null comment '内容'")
    @ApiModelProperty("内容")
    private String content;

    @Column(columnDefinition = "varchar(127) default null comment '参与者'")
    @ApiModelProperty("参与者")
    private String participant;

    @Temporal(TemporalType.DATE)
    @Column(columnDefinition = "date default null comment '截止日期'")
    @ApiModelProperty("开始日期")
    private Date startDay;

    @Temporal(TemporalType.DATE)
    @Column(columnDefinition = "date default null comment '截止日期'")
    @ApiModelProperty("截止日期")
    private Date endDay;

}
